﻿//==================================================================
// Copyright (C) 2011 深圳市中旭企业管理股份有限公司
// 文件名: V_CrmDeliverMajor.cs
// 作 者：代码自动生成
// 日 期：2012-12-5 10:56:37
// 描 述：
// 版 本：1.00
// 修改历史纪录
// 版 本  修改时间      修改人            修改内容
// 1.00             
//==================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Text;
using Csla;
using lite;
using Csla.Validation;
using Csla.Data;
using System.Data.SqlClient;
using ZX.DAL;
using OpenExpressApp.ORM;

namespace ZX.CRM.Library
{
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    [Table(Name = "V_CrmDeliverMajor")]
    [ZX.DBModule.Table("V_CrmDeliverMajor", "ID")]
    public class V_CrmDeliverMajor : ZX.DBModule.BaseEntity
    {
        #region Business Methods 业务方法
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> IDProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("ID"));
        [DataObjectField(true, true)]
        [Column, PK]
        public Guid ID
        {
            get { return GetProperty(IDProperty); }
            set { SetProperty(IDProperty, value); }
        }

        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CodeProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("Code"));
        [Column]
        public string Code
        {
            get { return GetProperty(CodeProperty); }
            set { SetProperty(CodeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> OrderProductIDProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("OrderProductID"));
        [Column]
        public Guid OrderProductID
        {
            get { return GetProperty(OrderProductIDProperty); }
            set { SetProperty(OrderProductIDProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> ProductLayoutIDProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("ProductLayoutID"));
        [Column]
        public Guid ProductLayoutID
        {
            get { return GetProperty(ProductLayoutIDProperty); }
            set { SetProperty(ProductLayoutIDProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> NegotiateTeachProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("NegotiateTeach"));
        [Column]
        public Guid NegotiateTeach
        {
            get { return GetProperty(NegotiateTeachProperty); }
            set { SetProperty(NegotiateTeachProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> ClassServerProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("ClassServer"));
        [Column]
        public Guid ClassServer
        {
            get { return GetProperty(ClassServerProperty); }
            set { SetProperty(ClassServerProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> ClassFrontServerProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("ClassFrontServer"));
        [Column]
        public Guid ClassFrontServer
        {
            get { return GetProperty(ClassFrontServerProperty); }
            set { SetProperty(ClassFrontServerProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> DliverStateProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("DliverState"));
        [Column]
        public Guid DliverState
        {
            get { return GetProperty(DliverStateProperty); }
            set { SetProperty(DliverStateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> IsSureProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("IsSure"));
        [Column]
        public string IsSure
        {
            get { return GetProperty(IsSureProperty); }
            set { SetProperty(IsSureProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> SureUserProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("SureUser"));
        [Column]
        public Guid SureUser
        {
            get { return GetProperty(SureUserProperty); }
            set { SetProperty(SureUserProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> SureTimeProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<DateTime>("SureTime"));
        [Column]
        public DateTime SureTime
        {
            get { return GetProperty(SureTimeProperty); }
            set { SetProperty(SureTimeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> AddUserProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("AddUser"));
        [Column]
        public Guid AddUser
        {
            get { return GetProperty(AddUserProperty); }
            set { SetProperty(AddUserProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> AddTimeProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<DateTime>("AddTime"));
        [Column]
        public DateTime AddTime
        {
            get { return GetProperty(AddTimeProperty); }
            set { SetProperty(AddTimeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> exp1Property = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("exp1"));
        [Column]
        public string exp1
        {
            get { return GetProperty(exp1Property); }
            set { SetProperty(exp1Property, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> exp2Property = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("exp2"));
        [Column]
        public string exp2
        {
            get { return GetProperty(exp2Property); }
            set { SetProperty(exp2Property, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> exp3Property = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("exp3"));
        [Column]
        public string exp3
        {
            get { return GetProperty(exp3Property); }
            set { SetProperty(exp3Property, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> exp4Property = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("exp4"));
        [Column]
        public string exp4
        {
            get { return GetProperty(exp4Property); }
            set { SetProperty(exp4Property, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> TeacherNameProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("TeacherName"));
        [Column]
        public string TeacherName
        {
            get { return GetProperty(TeacherNameProperty); }
            set { SetProperty(TeacherNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> ServerNameProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("ServerName"));
        [Column]
        public string ServerName
        {
            get { return GetProperty(ServerNameProperty); }
            set { SetProperty(ServerNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> FrontServerNameProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("FrontServerName"));
        [Column]
        public string FrontServerName
        {
            get { return GetProperty(FrontServerNameProperty); }
            set { SetProperty(FrontServerNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> AddUserNameProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("AddUserName"));
        [Column]
        public string AddUserName
        {
            get { return GetProperty(AddUserNameProperty); }
            set { SetProperty(AddUserNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> SureUserNameProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("SureUserName"));
        [Column]
        public string SureUserName
        {
            get { return GetProperty(SureUserNameProperty); }
            set { SetProperty(SureUserNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkFlowIdProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("WorkFlowId"));
        [Column]
        public string WorkFlowId
        {
            get { return GetProperty(WorkFlowIdProperty); }
            set { SetProperty(WorkFlowIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkFlowInsIdProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("WorkFlowInsId"));
        [Column]
        public string WorkFlowInsId
        {
            get { return GetProperty(WorkFlowInsIdProperty); }
            set { SetProperty(WorkFlowInsIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkTaskIdProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("WorkTaskId"));
        [Column]
        public string WorkTaskId
        {
            get { return GetProperty(WorkTaskIdProperty); }
            set { SetProperty(WorkTaskIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkTaskInsIdProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("WorkTaskInsId"));
        [Column]
        public string WorkTaskInsId
        {
            get { return GetProperty(WorkTaskInsIdProperty); }
            set { SetProperty(WorkTaskInsIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> GradeDeptIdProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("GradeDeptId"));
        [Column]
        public Guid GradeDeptId
        {
            get { return GetProperty(GradeDeptIdProperty); }
            set { SetProperty(GradeDeptIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> ConstDeptIdProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("ConstDeptId"));
        [Column]
        public Guid ConstDeptId
        {
            get { return GetProperty(ConstDeptIdProperty); }
            set { SetProperty(ConstDeptIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> GradeDeptNameProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("GradeDeptName"));
        [Column]
        public string GradeDeptName
        {
            get { return GetProperty(GradeDeptNameProperty); }
            set { SetProperty(GradeDeptNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> ConstDeptNameProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("ConstDeptName"));
        [Column]
        public string ConstDeptName
        {
            get { return GetProperty(ConstDeptNameProperty); }
            set { SetProperty(ConstDeptNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> CustomerIdProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("CustomerId"));
        [Column]
        public Guid CustomerId
        {
            get { return GetProperty(CustomerIdProperty); }
            set { SetProperty(CustomerIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CustomerCodeProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("CustomerCode"));
        [Column]
        public string CustomerCode
        {
            get { return GetProperty(CustomerCodeProperty); }
            set { SetProperty(CustomerCodeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CustomerNameProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("CustomerName"));
        [Column]
        public string CustomerName
        {
            get { return GetProperty(CustomerNameProperty); }
            set { SetProperty(CustomerNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> DeliverStateNameProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("DeliverStateName"));
        [Column]
        public string DeliverStateName
        {
            get { return GetProperty(DeliverStateNameProperty); }
            set { SetProperty(DeliverStateNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CourseLayoutNameProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<string>("CourseLayoutName"));
        [Column]
        public string CourseLayoutName
        {
            get { return GetProperty(CourseLayoutNameProperty); }
            set { SetProperty(CourseLayoutNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<decimal> AmountProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<decimal>("Amount"));
        [Column]
        public decimal Amount
        {
            get { return GetProperty(AmountProperty); }
            set { SetProperty(AmountProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> CustomeerMgrProperty = RegisterProperty(typeof(V_CrmDeliverMajor), new PropertyInfo<Guid>("CustomeerMgr"));
        [Column]
        public Guid CustomeerMgr
        {
            get { return GetProperty(CustomeerMgrProperty); }
            set { SetProperty(CustomeerMgrProperty, value); }
        }
        #endregion

        #region Validation Rules 验证规则
        //将验证规则与业务对象的属性联系在一起
        protected override void AddBusinessRules()
        {
            //AddRule的第一个参数是委托变量，也就是说是方法的变量
            ValidationRules.AddRule(CommonRules.StringRequired, "Code");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Code", 15));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsSure");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsSure", 1));
            ValidationRules.AddRule(CommonRules.StringRequired, "exp1");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("exp1", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "exp2");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("exp2", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "exp3");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("exp3", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "exp4");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("exp4", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "TeacherName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("TeacherName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "ServerName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ServerName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "FrontServerName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("FrontServerName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "AddUserName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("AddUserName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "SureUserName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("SureUserName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "WorkFlowId");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("WorkFlowId", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "WorkFlowInsId");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("WorkFlowInsId", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "WorkTaskId");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("WorkTaskId", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "WorkTaskInsId");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("WorkTaskInsId", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "GradeDeptName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("GradeDeptName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "ConstDeptName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ConstDeptName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "CustomerCode");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CustomerCode", 15));
            ValidationRules.AddRule(CommonRules.StringRequired, "CustomerName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CustomerName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "DeliverStateName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("DeliverStateName", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "CourseLayoutName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CourseLayoutName", 50));
            //base.AddBusinessRules();
        }
        #endregion

        #region Factory Methods 工厂方法

        public V_CrmDeliverMajor() { }

        public static V_CrmDeliverMajor New()
        {
            return DataPortal.Create<V_CrmDeliverMajor>();
        }
        public static V_CrmDeliverMajor Get(Guid ID)
        {
            return DataPortal.Fetch<V_CrmDeliverMajor>(new SingleLazyCriteria<V_CrmDeliverMajor, Guid>(ID, false));
        }
        public static void Delete(Guid ID)
        {
            DataPortal.Delete(ID);
        }

        #endregion

        #region Data Access 数据访问
        //由于DataPortal_create中没有对数据库的访问，所有标记了Runlocal特性，使得该方法只需在本地运行即可
        //如果代码中有访问数据库的方法，那么就不要用这个特性，使数据门户可以根据情况将此方法的运行选择在应用服务器还是本地
        [RunLocal()]
        protected override void DataPortal_Create()
        {
            //在此调用CheckRules对所有的属性进行验证规则的检查，这样检查只运行一次。
            ValidationRules.CheckRules();
        }


        //可以看到此方法没有标记任何特性
        //此方法要访问数据库所以不能标记本地，由于她没有任何数据库更新操作所以也无需事务性的保护
        //此方法调用结束后会隐含的调用MarkOld（）方法
        private void DataPortal_Fetch(Guid ID)
        {
            //通过连接字符串建立SQL连接对象，Using符号代表，范围释放的意思，SqlConnection对象会在此范围后被释放掉
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(ConnectionStringNames))
            {
                IDb db = DbFactory.Instance.GetDb(ctx.Connection);
                IQuery q = db.Query();
                q.Constrain("ID").Equal(ID);

                var data = db.Select<V_CrmDeliverMajor>(q)[0];
                LoadProperty(IDProperty, data.ID);
                LoadProperty(CodeProperty, data.Code);
                LoadProperty(OrderProductIDProperty, data.OrderProductID);
                LoadProperty(ProductLayoutIDProperty, data.ProductLayoutID);
                LoadProperty(NegotiateTeachProperty, data.NegotiateTeach);
                LoadProperty(ClassServerProperty, data.ClassServer);
                LoadProperty(ClassFrontServerProperty, data.ClassFrontServer);
                LoadProperty(DliverStateProperty, data.DliverState);
                LoadProperty(IsSureProperty, data.IsSure);
                LoadProperty(SureUserProperty, data.SureUser);
                LoadProperty(SureTimeProperty, data.SureTime);
                LoadProperty(AddUserProperty, data.AddUser);
                LoadProperty(AddTimeProperty, data.AddTime);
                LoadProperty(exp1Property, data.exp1);
                LoadProperty(exp2Property, data.exp2);
                LoadProperty(exp3Property, data.exp3);
                LoadProperty(exp4Property, data.exp4);
                LoadProperty(TeacherNameProperty, data.TeacherName);
                LoadProperty(ServerNameProperty, data.ServerName);
                LoadProperty(FrontServerNameProperty, data.FrontServerName);
                LoadProperty(AddUserNameProperty, data.AddUserName);
                LoadProperty(SureUserNameProperty, data.SureUserName);
                LoadProperty(WorkFlowIdProperty, data.WorkFlowId);
                LoadProperty(WorkFlowInsIdProperty, data.WorkFlowInsId);
                LoadProperty(WorkTaskIdProperty, data.WorkTaskId);
                LoadProperty(WorkTaskInsIdProperty, data.WorkTaskInsId);
                LoadProperty(GradeDeptIdProperty, data.GradeDeptId);
                LoadProperty(ConstDeptIdProperty, data.ConstDeptId);
                LoadProperty(GradeDeptNameProperty, data.GradeDeptName);
                LoadProperty(ConstDeptNameProperty, data.ConstDeptName);
                LoadProperty(CustomerIdProperty, data.CustomerId);
                LoadProperty(CustomerCodeProperty, data.CustomerCode);
                LoadProperty(CustomerNameProperty, data.CustomerName);
                LoadProperty(DeliverStateNameProperty, data.DeliverStateName);
                LoadProperty(CourseLayoutNameProperty, data.CourseLayoutName);
                LoadProperty(AmountProperty, data.Amount);
                LoadProperty(CustomeerMgrProperty, data.CustomeerMgr);
            }
        }

        [Transactional(TransactionalTypes.TransactionScope)]
        protected override void DataPortal_DeleteSelf()
        {
            //依然是调用下面的方法删除的，只是他此时可以获得自己的Id
            DataPortal_Delete(IDProperty);
        }
        #endregion
    }
}

